package com.next

class OpportunityType
{
    String code
    String name

    static hasMany = [stages: OpportunityStage, subtypes: OpportunitySubtype]

    static constraints = {
        code unique: true
        code size: 2..2

        name unique: true
        name size: 2..32
    }

    static mapping = {
        sort 'code'
    }

    String toString()
    {
        name
    }
}
